package com.zjtaixue.o2o.dto;

import com.zjtaixue.o2o.entity.Shop;
import com.zjtaixue.o2o.enums.ShopStatusEnum;
import lombok.Getter;

import java.util.List;

@Getter
public class ShopExecution {

    //结果状态标识
    private int code;

    //结果状态信息
    private String msg;

    //店铺数量
    private int count;

    //操作的shop(增删改查)
    private Shop shop;

    //shop列表的使用
    private List<Shop> shopList;


    /**
     * 店铺操作失败的构造器
     * @param statusEnum
     */
    public ShopExecution(ShopStatusEnum statusEnum){
        this.code=statusEnum.getCode();
        this.msg=statusEnum.getMsg();
    }


    /**
     * 店铺操作成功的构造器
     * @param statusEnum
     * @param shop
     */
    public ShopExecution(ShopStatusEnum statusEnum,Shop shop){
        this.code=statusEnum.getCode();
        this.msg=statusEnum.getMsg();
        this.shop=shop;
    }

    /**
     * 店铺操作成功的构造器
     * @param statusEnum
     * @param shopList
     */
    public ShopExecution(ShopStatusEnum statusEnum,List<Shop> shopList){
        this.code=statusEnum.getCode();
        this.msg=statusEnum.getMsg();
        this.shopList=shopList;
    }

    /**
     * 店铺操作成功的构造器
     * @param count
     * @param statusEnum
     * @param shopList
     */
    public ShopExecution(int count,List<Shop> shopList, ShopStatusEnum statusEnum ) {
        this.code=statusEnum.getCode();
        this.msg=statusEnum.getMsg();
        this.shopList = shopList;
        this.count=count;
    }

}
